package Invalid;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;


public class DesktopClient {
	public static void main(String[] args)
    {
		Scanner in2 = new Scanner( System.in );
		System.out.print("User Name: ");
		String username = in2.nextLine();
		
		try
	    {
			Socket s = new Socket("lore.cs.purdue.edu", 2222);
			try
			{
			    InputStream inStream = s.getInputStream();
			    Scanner in = new Scanner(inStream);
			    
			    
			    OutputStream outStream = s.getOutputStream();
			    PrintWriter out = new PrintWriter(outStream, true);
			    out.print(username);
			    while (true)
			    {
			       String line = in.nextLine();
			       System.out.println(line);
			    }
			 }
			 finally
			 {
			    s.close();
			 }
		}
		catch (IOException e)
		{
		   e.printStackTrace();
		}
    }
}
